package common;

import java.io.Serializable;

public class User implements Serializable {
    private String id;
    private String pwd;
    private Code code;
    private String name;
    private String number;
    private String phone;
    private String birth;
    private int state=0;
    public final static int onLine=1;
    //注册用 构造函数
    public User(String id, String pwd, Code code, String name, String phone, String birth) {
        this.id = id;
        this.pwd = pwd;
        this.code = code;
        this.name = name;
        this.phone = phone;
        this.birth = birth;
    }
    //个人资料用 构造函数
    public User(String id, String name, String number, String phone, String birth) {
        this.id = id;
        this.name = name;
        this.number = number;
        this.phone = phone;
        this.birth = birth;
    }
    //登录用 构造函数
    public User(String id, String pwd) {
        this.id = id;
        this.pwd = pwd;
    }
    //忘记密码用 构造函数
    public User(String id, String pwd, Code code) {
        this.id = id;
        this.pwd = pwd;
        this.code = code;
    }

    public String getId() {
        return id;
    }

    public String getPwd() {
        return pwd;
    }

    public Code getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getPhone() {
        return phone;
    }

    public String getBirth() {
        return birth;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setBirth(String birth) {
        this.birth = birth;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof User)) {
            return false;
        }
        User user=(User) obj;
        return this.id.equals(((User) obj).getId());
    }
}